const { Console } = require('node:console')
const fs = require('node:fs')

const logger = new Console({ stdout: process.stdout, stderr: process.stderr });


const output = fs.createWriteStream('./record.log');
const errorOutput = fs.createWriteStream('./stderr.log');
const recorder = new Console({ stdout: output, stderr: output });
recorder.clear();

recorder.log('hello world5');
recorder.log('hello world5');
recorder.log('hello world5');
recorder.error('hello world6');
recorder.error('hello world6');
recorder.error('hello world6');
recorder.error('hello world6');
recorder.log('hello world5');
recorder.error('hello world6');
recorder.error('hello world6');
recorder.error('hello world6');
recorder.error('hello world6');
recorder.error('hello world6');



setTimeout(() => {
    console.log(fs.readFileSync('./record.log', 'utf8'));
}, 1000);

console.log((1665630147363 - 1664269540342) > 1000 * 60 * 60 * 24);


